import { LazyLoader } from "@sapi-game/gameComponent/common/lazyLoader";
import { DimensionIds } from "@sapi-game/utils/vanila-data";
import { baseModule } from "@/base/module";
import { MonopolyConfigSetter } from "../components/configSetter";
import { MonopolyGameStarter } from "../components/starter";

export class MonopolyBackState extends baseModule.State {
    override onEnter(): void {
        this.addComponent(LazyLoader, {
            onLoad: this.load.bind(this),
            pos: { x: -190, y: -38, z: 259 },
            dimensionId: DimensionIds.Overworld,
        });
    }

    load(loader: LazyLoader) {
        loader
            .addComponent(MonopolyConfigSetter)
            .addComponent(MonopolyGameStarter);
    }
}
